
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Jedis常见问题汇总 · 继松的书</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="jisong">
        
        
    
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../../styles/website.css">
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Redis info详解.html" />
    
    
    <link rel="prev" href="0-README.html" />
    

    
    <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    
        <link rel="shortcut icon" href='../../favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../favicon.ico' type="image/x-icon">
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://ji-song.gitee.io/cc" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                        <b>1.1.</b>
                    
                    继松的笔记
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Developer</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../Flink/0-README.html">
            
                <a href="../Flink/0-README.html">
            
                    
                        <b>2.1.</b>
                    
                    Flink
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="../Flink/or01-初学 Flink.html">
            
                <a href="../Flink/or01-初学 Flink.html">
            
                    
                        <b>2.1.1.</b>
                    
                    初学 Flink
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="../Flink/or02-Flink中Keyby和线程数的疑问.html">
            
                <a href="../Flink/or02-Flink中Keyby和线程数的疑问.html">
            
                    
                        <b>2.1.2.</b>
                    
                    Flink中Keyby和线程数的疑问
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="../Flink/or03-Flink-Spark-Storm的区别.html">
            
                <a href="../Flink/or03-Flink-Spark-Storm的区别.html">
            
                    
                        <b>2.1.3.</b>
                    
                    Flink-Spark-Storm的区别
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="../Flink/or04-Flink 异常笔记.html">
            
                <a href="../Flink/or04-Flink 异常笔记.html">
            
                    
                        <b>2.1.4.</b>
                    
                    Flink 异常笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../JDK/0-README.html">
            
                <a href="../JDK/0-README.html">
            
                    
                        <b>2.2.</b>
                    
                    JDK
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="../JDK/Lock/0-README.html">
            
                <a href="../JDK/Lock/0-README.html">
            
                    
                        <b>2.2.1.</b>
                    
                    Lock
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1.1" data-path="../JDK/Lock/AQS.html">
            
                <a href="../JDK/Lock/AQS.html">
            
                    
                        <b>2.2.1.1.</b>
                    
                    AQS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.2" data-path="../JDK/Lock/LinkedBlockingQueue.html">
            
                <a href="../JDK/Lock/LinkedBlockingQueue.html">
            
                    
                        <b>2.2.1.2.</b>
                    
                    LinkedBlockingQueue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.3" data-path="../JDK/Lock/ReadWriteLock.html">
            
                <a href="../JDK/Lock/ReadWriteLock.html">
            
                    
                        <b>2.2.1.3.</b>
                    
                    ReadWriteLock
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.4" data-path="../JDK/Lock/[12090055]ReentrantLock.html">
            
                <a href="../JDK/Lock/[12090055]ReentrantLock.html">
            
                    
                        <b>2.2.1.4.</b>
                    
                    ReentrantLock
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.2" data-path="../JDK/Period 时间坑.html">
            
                <a href="../JDK/Period 时间坑.html">
            
                    
                        <b>2.2.2.</b>
                    
                    Period 时间坑
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3" data-path="../JDK/Pool/0-README.html">
            
                <a href="../JDK/Pool/0-README.html">
            
                    
                        <b>2.2.3.</b>
                    
                    Pool
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.3.1" data-path="../JDK/Pool/ThreadPoolExecutor.html">
            
                <a href="../JDK/Pool/ThreadPoolExecutor.html">
            
                    
                        <b>2.2.3.1.</b>
                    
                    ThreadPoolExecutor
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.2" data-path="../JDK/Pool/多线程并发导致CPU100%的一种原因和解决方式.html">
            
                <a href="../JDK/Pool/多线程并发导致CPU100%的一种原因和解决方式.html">
            
                    
                        <b>2.2.3.2.</b>
                    
                    多线程并发导致CPU100%的一种原因和解决方式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.4" data-path="../JDK/Proxy的工作原理[0%].html">
            
                <a href="../JDK/Proxy的工作原理[0%].html">
            
                    
                        <b>2.2.4.</b>
                    
                    Proxy的工作原理[0%]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.5" data-path="../JDK/Util/0-README.html">
            
                <a href="../JDK/Util/0-README.html">
            
                    
                        <b>2.2.5.</b>
                    
                    Util
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.5.1" data-path="../JDK/Util/HashMap.html">
            
                <a href="../JDK/Util/HashMap.html">
            
                    
                        <b>2.2.5.1.</b>
                    
                    HashMap
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="../JVM/0-README.html">
            
                <a href="../JVM/0-README.html">
            
                    
                        <b>2.3.</b>
                    
                    JVM
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="../JVM/or01-内存区域.html">
            
                <a href="../JVM/or01-内存区域.html">
            
                    
                        <b>2.3.1.</b>
                    
                    内存区域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="../JVM/or02-内存模型.html">
            
                <a href="../JVM/or02-内存模型.html">
            
                    
                        <b>2.3.2.</b>
                    
                    内存模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.3" data-path="../JVM/or03-内存优化.html">
            
                <a href="../JVM/or03-内存优化.html">
            
                    
                        <b>2.3.3.</b>
                    
                    内存优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.4" data-path="../JVM/or04-JVM参数集.html">
            
                <a href="../JVM/or04-JVM参数集.html">
            
                    
                        <b>2.3.4.</b>
                    
                    JVM参数集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.5" data-path="../JVM/or05-JVM指令集.html">
            
                <a href="../JVM/or05-JVM指令集.html">
            
                    
                        <b>2.3.5.</b>
                    
                    JVM指令集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.6" data-path="../JVM/or06-垃圾收集器.html">
            
                <a href="../JVM/or06-垃圾收集器.html">
            
                    
                        <b>2.3.6.</b>
                    
                    垃圾收集器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.7" data-path="../JVM/or07-垃圾收集器优化.html">
            
                <a href="../JVM/or07-垃圾收集器优化.html">
            
                    
                        <b>2.3.7.</b>
                    
                    垃圾收集器优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.8" data-path="../JVM/or08-Arthus.html">
            
                <a href="../JVM/or08-Arthus.html">
            
                    
                        <b>2.3.8.</b>
                    
                    Arthus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.9" data-path="../JVM/or09-Sychronized.html">
            
                <a href="../JVM/or09-Sychronized.html">
            
                    
                        <b>2.3.9.</b>
                    
                    Sychronized
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="../Kafka/0-README.html">
            
                <a href="../Kafka/0-README.html">
            
                    
                        <b>2.4.</b>
                    
                    Kafka
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="../Kafka/Kafka高吞吐量的原理[0%].html">
            
                <a href="../Kafka/Kafka高吞吐量的原理[0%].html">
            
                    
                        <b>2.4.1.</b>
                    
                    Kafka高吞吐量的原理[0%]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="../Kafka/kafka的消费时机.html">
            
                <a href="../Kafka/kafka的消费时机.html">
            
                    
                        <b>2.4.2.</b>
                    
                    kafka的消费时机
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.3" data-path="../Kafka/参数详解[1%].html">
            
                <a href="../Kafka/参数详解[1%].html">
            
                    
                        <b>2.4.3.</b>
                    
                    参数详解[1%]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.4" data-path="../Kafka/问题点[1%].html">
            
                <a href="../Kafka/问题点[1%].html">
            
                    
                        <b>2.4.4.</b>
                    
                    问题点[1%]
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="../MySQL/0-README.html">
            
                <a href="../MySQL/0-README.html">
            
                    
                        <b>2.5.</b>
                    
                    MySQL
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="../MySQL/B树.html">
            
                <a href="../MySQL/B树.html">
            
                    
                        <b>2.5.1.</b>
                    
                    B树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.2" data-path="../MySQL/MySQL 处理重复数据.html">
            
                <a href="../MySQL/MySQL 处理重复数据.html">
            
                    
                        <b>2.5.2.</b>
                    
                    MySQL 处理重复数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.3" data-path="../MySQL/MySQL常用命令.html">
            
                <a href="../MySQL/MySQL常用命令.html">
            
                    
                        <b>2.5.3.</b>
                    
                    MySQL常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.4" data-path="../MySQL/MySQL数据类型.html">
            
                <a href="../MySQL/MySQL数据类型.html">
            
                    
                        <b>2.5.4.</b>
                    
                    MySQL数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.5" data-path="../MySQL/explain.html">
            
                <a href="../MySQL/explain.html">
            
                    
                        <b>2.5.5.</b>
                    
                    explain
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.6" data-path="../MySQL/写SQL的注意点.html">
            
                <a href="../MySQL/写SQL的注意点.html">
            
                    
                        <b>2.5.6.</b>
                    
                    写SQL的注意点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="../Python/0-README.html">
            
                <a href="../Python/0-README.html">
            
                    
                        <b>2.6.</b>
                    
                    Python
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="0-README.html">
            
                <a href="0-README.html">
            
                    
                        <b>2.7.</b>
                    
                    Redis
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="2.7.1" data-path="Jedis常见问题汇总.html">
            
                <a href="Jedis常见问题汇总.html">
            
                    
                        <b>2.7.1.</b>
                    
                    Jedis常见问题汇总
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.2" data-path="Redis info详解.html">
            
                <a href="Redis info详解.html">
            
                    
                        <b>2.7.2.</b>
                    
                    Redis info详解
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="../Spring/0-README.html">
            
                <a href="../Spring/0-README.html">
            
                    
                        <b>2.8.</b>
                    
                    Spring
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.8.1" data-path="../Spring/Spring AOP详解[0%].html">
            
                <a href="../Spring/Spring AOP详解[0%].html">
            
                    
                        <b>2.8.1.</b>
                    
                    Spring AOP详解[0%]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8.2" data-path="../Spring/Spring 容器里都装了哪些bean.html">
            
                <a href="../Spring/Spring 容器里都装了哪些bean.html">
            
                    
                        <b>2.8.2.</b>
                    
                    Spring 容器里都装了哪些bean
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8.3" data-path="../Spring/[11770408]Spring-Cache手动清缓存.html">
            
                <a href="../Spring/[11770408]Spring-Cache手动清缓存.html">
            
                    
                        <b>2.8.3.</b>
                    
                    Spring-Cache手动清缓存
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="../kotlin/0-README.html">
            
                <a href="../kotlin/0-README.html">
            
                    
                        <b>2.9.</b>
                    
                    kotlin
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="../工作心得/0-README.html">
            
                <a href="../工作心得/0-README.html">
            
                    
                        <b>2.10.</b>
                    
                    工作心得
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.10.1" data-path="../工作心得/HttpClient高并发下性能优化-http连接池.html">
            
                <a href="../工作心得/HttpClient高并发下性能优化-http连接池.html">
            
                    
                        <b>2.10.1.</b>
                    
                    HttpClient高并发下性能优化-http连接池
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.2" data-path="../工作心得/List 快速去重.html">
            
                <a href="../工作心得/List 快速去重.html">
            
                    
                        <b>2.10.2.</b>
                    
                    List 快速去重
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.3" data-path="../工作心得/MAVEN依赖问题.html">
            
                <a href="../工作心得/MAVEN依赖问题.html">
            
                    
                        <b>2.10.3.</b>
                    
                    MAVEN依赖问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.4" data-path="../工作心得/MyBatis使用JDK8的日期类Handler.html">
            
                <a href="../工作心得/MyBatis使用JDK8的日期类Handler.html">
            
                    
                        <b>2.10.4.</b>
                    
                    MyBatis使用JDK8的日期类Handler
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.5" data-path="../工作心得/Mybatis缓存笔记.html">
            
                <a href="../工作心得/Mybatis缓存笔记.html">
            
                    
                        <b>2.10.5.</b>
                    
                    Mybatis缓存笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.6" data-path="../工作心得/Mybatis配置详解.html">
            
                <a href="../工作心得/Mybatis配置详解.html">
            
                    
                        <b>2.10.6.</b>
                    
                    Mybatis配置详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.7" data-path="../工作心得/log4j动态修改日志级别.html">
            
                <a href="../工作心得/log4j动态修改日志级别.html">
            
                    
                        <b>2.10.7.</b>
                    
                    log4j动态修改日志级别
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.8" data-path="../工作心得/收藏的文章.html">
            
                <a href="../工作心得/收藏的文章.html">
            
                    
                        <b>2.10.8.</b>
                    
                    收藏的文章
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.9" data-path="../工作心得/数据不一致问题.html">
            
                <a href="../工作心得/数据不一致问题.html">
            
                    
                        <b>2.10.9.</b>
                    
                    数据不一致问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.10" data-path="../工作心得/站会制度.html">
            
                <a href="../工作心得/站会制度.html">
            
                    
                        <b>2.10.10.</b>
                    
                    站会制度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="../微服务/0-README.html">
            
                <a href="../微服务/0-README.html">
            
                    
                        <b>2.11.</b>
                    
                    微服务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.11.1" data-path="../微服务/dubbo-注入spring为空.html">
            
                <a href="../微服务/dubbo-注入spring为空.html">
            
                    
                        <b>2.11.1.</b>
                    
                    dubbo-注入spring为空
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.11.2" data-path="../微服务/dubbo在zk中都存了哪些东西[10%].html">
            
                <a href="../微服务/dubbo在zk中都存了哪些东西[10%].html">
            
                    
                        <b>2.11.2.</b>
                    
                    dubbo在zk中都存了哪些东西[10%]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.11.3" data-path="../微服务/zookeeper命令[1%].html">
            
                <a href="../微服务/zookeeper命令[1%].html">
            
                    
                        <b>2.11.3.</b>
                    
                    zookeeper命令[1%]
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">OS</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../../OS/Linux/0-README.html">
            
                <a href="../../OS/Linux/0-README.html">
            
                    
                        <b>3.1.</b>
                    
                    Linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="../../OS/Linux/Deepin Linux安装wine5.0.html">
            
                <a href="../../OS/Linux/Deepin Linux安装wine5.0.html">
            
                    
                        <b>3.1.1.</b>
                    
                    Deepin Linux安装wine5.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="../../OS/Linux/Deepin修改使用aliyun的软件源.html">
            
                <a href="../../OS/Linux/Deepin修改使用aliyun的软件源.html">
            
                    
                        <b>3.1.2.</b>
                    
                    Deepin修改使用aliyun的软件源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="../../OS/Linux/Linux最常用命令.html">
            
                <a href="../../OS/Linux/Linux最常用命令.html">
            
                    
                        <b>3.1.3.</b>
                    
                    Linux最常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4" data-path="../../OS/Linux/TOP命令.html">
            
                <a href="../../OS/Linux/TOP命令.html">
            
                    
                        <b>3.1.4.</b>
                    
                    TOP命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5" data-path="../../OS/Linux/bash_alias.html">
            
                <a href="../../OS/Linux/bash_alias.html">
            
                    
                        <b>3.1.5.</b>
                    
                    bash_alias
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6" data-path="../../OS/Linux/dpkg.html">
            
                <a href="../../OS/Linux/dpkg.html">
            
                    
                        <b>3.1.6.</b>
                    
                    dpkg
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.7" data-path="../../OS/Linux/find.html">
            
                <a href="../../OS/Linux/find.html">
            
                    
                        <b>3.1.7.</b>
                    
                    find
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.8" data-path="../../OS/Linux/oh-my-zsh.html">
            
                <a href="../../OS/Linux/oh-my-zsh.html">
            
                    
                        <b>3.1.8.</b>
                    
                    oh-my-zsh
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../../OS/Mac/0-README.html">
            
                <a href="../../OS/Mac/0-README.html">
            
                    
                        <b>3.2.</b>
                    
                    Mac
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.2.1" data-path="../../OS/Mac/MacBook安装brew.html">
            
                <a href="../../OS/Mac/MacBook安装brew.html">
            
                    
                        <b>3.2.1.</b>
                    
                    MacBook安装brew
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../../OS/Windows/0-README.html">
            
                <a href="../../OS/Windows/0-README.html">
            
                    
                        <b>3.3.</b>
                    
                    Windows
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.3.1" data-path="../../OS/Windows/WSL的ssh-agent问题.html">
            
                <a href="../../OS/Windows/WSL的ssh-agent问题.html">
            
                    
                        <b>3.3.1.</b>
                    
                    WSL的ssh-agent问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3.2" data-path="../../OS/Windows/windows10使用任务计划提醒自己.html">
            
                <a href="../../OS/Windows/windows10使用任务计划提醒自己.html">
            
                    
                        <b>3.3.2.</b>
                    
                    windows10使用任务计划提醒自己
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3.3" data-path="../../OS/Windows/win下的终端使用指南.html">
            
                <a href="../../OS/Windows/win下的终端使用指南.html">
            
                    
                        <b>3.3.3.</b>
                    
                    win下的终端使用指南
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">TOOLS</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../../TOOLS/IDEA/0-README.html">
            
                <a href="../../TOOLS/IDEA/0-README.html">
            
                    
                        <b>4.1.</b>
                    
                    IDEA
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="../../TOOLS/IDEA/IDEA配置终端.html">
            
                <a href="../../TOOLS/IDEA/IDEA配置终端.html">
            
                    
                        <b>4.1.1.</b>
                    
                    IDEA配置终端
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="../../TOOLS/IDEA/去掉重复代码的提醒.html">
            
                <a href="../../TOOLS/IDEA/去掉重复代码的提醒.html">
            
                    
                        <b>4.1.2.</b>
                    
                    去掉重复代码的提醒
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3" data-path="../../TOOLS/IDEA/字体JetBrain mono.html">
            
                <a href="../../TOOLS/IDEA/字体JetBrain mono.html">
            
                    
                        <b>4.1.3.</b>
                    
                    字体JetBrain mono
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4" data-path="../../TOOLS/IDEA/常用插件.html">
            
                <a href="../../TOOLS/IDEA/常用插件.html">
            
                    
                        <b>4.1.4.</b>
                    
                    常用插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5" data-path="../../TOOLS/IDEA/自定义TODO.html">
            
                <a href="../../TOOLS/IDEA/自定义TODO.html">
            
                    
                        <b>4.1.5.</b>
                    
                    自定义TODO
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../../TOOLS/checkstyle/0-README.html">
            
                <a href="../../TOOLS/checkstyle/0-README.html">
            
                    
                        <b>4.2.</b>
                    
                    checkstyle
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.2.1" data-path="../../TOOLS/checkstyle/checkstyle.xml.html">
            
                <a href="../../TOOLS/checkstyle/checkstyle.xml.html">
            
                    
                        <b>4.2.1.</b>
                    
                    checkstyle.xml
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2.2" data-path="../../TOOLS/checkstyle/githook使用checkstyle.html">
            
                <a href="../../TOOLS/checkstyle/githook使用checkstyle.html">
            
                    
                        <b>4.2.2.</b>
                    
                    githook使用checkstyle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2.3" data-path="../../TOOLS/checkstyle/pre-commit.html">
            
                <a href="../../TOOLS/checkstyle/pre-commit.html">
            
                    
                        <b>4.2.3.</b>
                    
                    pre-commit
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../../TOOLS/docker/0-README.html">
            
                <a href="../../TOOLS/docker/0-README.html">
            
                    
                        <b>4.3.</b>
                    
                    docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.3.1" data-path="../../TOOLS/docker/Docker 常用命令.html">
            
                <a href="../../TOOLS/docker/Docker 常用命令.html">
            
                    
                        <b>4.3.1.</b>
                    
                    Docker 常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3.2" data-path="../../TOOLS/docker/deepin中安装docker.html">
            
                <a href="../../TOOLS/docker/deepin中安装docker.html">
            
                    
                        <b>4.3.2.</b>
                    
                    deepin中安装docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3.3" data-path="../../TOOLS/docker/docker-compose安装.html">
            
                <a href="../../TOOLS/docker/docker-compose安装.html">
            
                    
                        <b>4.3.3.</b>
                    
                    docker-compose安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3.4" data-path="../../TOOLS/docker/docker-compose简化docker命令.html">
            
                <a href="../../TOOLS/docker/docker-compose简化docker命令.html">
            
                    
                        <b>4.3.4.</b>
                    
                    docker-compose简化docker命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="../../TOOLS/git/0-README.html">
            
                <a href="../../TOOLS/git/0-README.html">
            
                    
                        <b>4.4.</b>
                    
                    git
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="../../TOOLS/git/[11769588]git配置多仓库.html">
            
                <a href="../../TOOLS/git/[11769588]git配置多仓库.html">
            
                    
                        <b>4.4.1.</b>
                    
                    git配置多仓库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="../../TOOLS/git/各GIt仓库的api.html">
            
                <a href="../../TOOLS/git/各GIt仓库的api.html">
            
                    
                        <b>4.4.2.</b>
                    
                    各GIt仓库的api
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="../../TOOLS/ssh/0-README.html">
            
                <a href="../../TOOLS/ssh/0-README.html">
            
                    
                        <b>4.5.</b>
                    
                    ssh
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.1" data-path="../../TOOLS/ssh/ssh配置公钥私钥登录服务器.html">
            
                <a href="../../TOOLS/ssh/ssh配置公钥私钥登录服务器.html">
            
                    
                        <b>4.5.1.</b>
                    
                    ssh配置公钥私钥登录服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5.2" data-path="../../TOOLS/ssh/ssh配置跳板机-带密钥.html">
            
                <a href="../../TOOLS/ssh/ssh配置跳板机-带密钥.html">
            
                    
                        <b>4.5.2.</b>
                    
                    ssh配置跳板机-带密钥
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="../../TOOLS/sublime/0-README.html">
            
                <a href="../../TOOLS/sublime/0-README.html">
            
                    
                        <b>4.6.</b>
                    
                    sublime
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.6.1" data-path="../../TOOLS/sublime/sublime使用笔记.html">
            
                <a href="../../TOOLS/sublime/sublime使用笔记.html">
            
                    
                        <b>4.6.1.</b>
                    
                    sublime使用笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6.2" data-path="../../TOOLS/sublime/sublime替换本地记事本.html">
            
                <a href="../../TOOLS/sublime/sublime替换本地记事本.html">
            
                    
                        <b>4.6.2.</b>
                    
                    sublime替换本地记事本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6.3" data-path="../../TOOLS/sublime/去掉升级提醒.html">
            
                <a href="../../TOOLS/sublime/去掉升级提醒.html">
            
                    
                        <b>4.6.3.</b>
                    
                    去掉升级提醒
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.7" >
            
                <span>
            
                    
                        <b>4.7.</b>
                    
                    Spring
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="4.8" >
            
                <span>
            
                    
                        <b>4.8.</b>
                    
                    cglib
            
                </span>
            

            
        </li>
    

    
        
        <li class="header">前端</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../../前端/blog/0-README.html">
            
                <a href="../../前端/blog/0-README.html">
            
                    
                        <b>5.1.</b>
                    
                    blog
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../../前端/chrome/0-README.html">
            
                <a href="../../前端/chrome/0-README.html">
            
                    
                        <b>5.2.</b>
                    
                    chrome
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.2.1" data-path="../../前端/chrome/or01-扩展插件开发.html">
            
                <a href="../../前端/chrome/or01-扩展插件开发.html">
            
                    
                        <b>5.2.1.</b>
                    
                    扩展插件开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2.2" data-path="../../前端/chrome/or02-禁用chrome的快捷键.html">
            
                <a href="../../前端/chrome/or02-禁用chrome的快捷键.html">
            
                    
                        <b>5.2.2.</b>
                    
                    禁用chrome的快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2.3" data-path="../../前端/chrome/or03-小工具插件.html">
            
                <a href="../../前端/chrome/or03-小工具插件.html">
            
                    
                        <b>5.2.3.</b>
                    
                    小工具插件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="../../前端/gitbook/0-README.html">
            
                <a href="../../前端/gitbook/0-README.html">
            
                    
                        <b>5.3.</b>
                    
                    gitbook
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">小记</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="../../小记/游戏/0-README.html">
            
                <a href="../../小记/游戏/0-README.html">
            
                    
                        <b>6.1.</b>
                    
                    游戏
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.1" data-path="../../小记/游戏/[12090043]重新机兵回归(MMR">
            
                <span>
            
                    
                        <b>6.1.1.</b>
                    
                    重新机兵回归(MMR)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2" data-path="../../小记/游戏/上古卷轴5.html">
            
                <a href="../../小记/游戏/上古卷轴5.html">
            
                    
                        <b>6.1.2.</b>
                    
                    上古卷轴5
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="../../小记/电影/0-README.html">
            
                <a href="../../小记/电影/0-README.html">
            
                    
                        <b>6.2.</b>
                    
                    电影
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.2.1" data-path="../../小记/电影/动画电影-和谐.html">
            
                <a href="../../小记/电影/动画电影-和谐.html">
            
                    
                        <b>6.2.1.</b>
                    
                    动画电影-和谐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2.2" data-path="../../小记/电影/哈利波特.html">
            
                <a href="../../小记/电影/哈利波特.html">
            
                    
                        <b>6.2.2.</b>
                    
                    哈利波特
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2.3" data-path="../../小记/电影/永无止镜.html">
            
                <a href="../../小记/电影/永无止镜.html">
            
                    
                        <b>6.2.3.</b>
                    
                    永无止镜
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2.4" data-path="../../小记/电影/黑客帝国.html">
            
                <a href="../../小记/电影/黑客帝国.html">
            
                    
                        <b>6.2.4.</b>
                    
                    黑客帝国
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="../../小记/目标/0-README.html">
            
                <a href="../../小记/目标/0-README.html">
            
                    
                        <b>6.3.</b>
                    
                    目标
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.3.1" data-path="../../小记/目标/淘宝店.html">
            
                <a href="../../小记/目标/淘宝店.html">
            
                    
                        <b>6.3.1.</b>
                    
                    淘宝店
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="../../小记/眼球震颤/0-README.html">
            
                <a href="../../小记/眼球震颤/0-README.html">
            
                    
                        <b>6.4.</b>
                    
                    眼球震颤
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Jedis常见问题汇总</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p><a href="https://yq.aliyun.com/articles/236384#cc17" target="_blank">https://yq.aliyun.com/articles/236384#cc17</a></p>
<h2 id="&#x4E00;&#x65E0;&#x6CD5;&#x4ECE;&#x8FDE;&#x63A5;&#x6C60;&#x83B7;&#x53D6;&#x5230;jedis&#x8FDE;&#x63A5;"><a name="&#x4E00;&#x65E0;&#x6CD5;&#x4ECE;&#x8FDE;&#x63A5;&#x6C60;&#x83B7;&#x53D6;&#x5230;jedis&#x8FDE;&#x63A5;" class="anchor-navigation-ex-anchor" href="#&#x4E00;&#x65E0;&#x6CD5;&#x4ECE;&#x8FDE;&#x63A5;&#x6C60;&#x83B7;&#x53D6;&#x5230;jedis&#x8FDE;&#x63A5;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4E00;.&#x65E0;&#x6CD5;&#x4ECE;&#x8FDE;&#x63A5;&#x6C60;&#x83B7;&#x53D6;&#x5230;Jedis&#x8FDE;&#x63A5;</h2>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool</p>
</blockquote>
<p>1.&#x5F02;&#x5E38;&#x5806;&#x6808;</p>
<p>(1) &#x8FDE;&#x63A5;&#x6C60;&#x53C2;&#x6570;blockWhenExhausted = true(&#x9ED8;&#x8BA4;)</p>
<p>&#x5982;&#x679C;&#x8FDE;&#x63A5;&#x6C60;&#x6CA1;&#x6709;&#x53EF;&#x7528;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x4F1A;&#x7B49;&#x5F85;maxWaitMillis(&#x6BEB;&#x79D2;)&#xFF0C;&#x4F9D;&#x7136;&#x6CA1;&#x6709;&#x83B7;&#x53D6;&#x5230;&#x53EF;&#x7528;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x4F1A;&#x629B;&#x51FA;&#x5982;&#x4E0B;&#x5F02;&#x5E38;&#xFF1A;</p>
<pre class="language-"><code>redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
    &#x2026;
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:449)
</code></pre><p>(2) &#x8FDE;&#x63A5;&#x6C60;&#x53C2;&#x6570;blockWhenExhausted = false</p>
<p>&#x8BBE;&#x7F6E;&#x5982;&#x679C;&#x8FDE;&#x63A5;&#x6C60;&#x6CA1;&#x6709;&#x53EF;&#x7528;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x7ACB;&#x5373;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#xFF1A;</p>
<pre class="language-"><code>redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
    &#x2026;
Caused by: java.util.NoSuchElementException: Pool exhausted
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:464)
</code></pre><p>2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;
<img src="../../assets/redis-2b92a64590ccc47930f55b2a0b689aa9a97f4b5f.png" alt="1"></p>
<p>&#x4E0A;&#x8FF0;&#x5F02;&#x5E38;&#x662F;&#x5BA2;&#x6237;&#x7AEF;&#x6CA1;&#x6709;&#x4ECE;&#x8FDE;&#x63A5;&#x6C60;(&#x6700;&#x5927;maxTotal&#x4E2A;)&#x62FF;&#x5230;&#x53EF;&#x7528;Jedis&#x8FDE;&#x63A5;&#x9020;&#x6210;&#x7684;&#xFF0C;&#x5177;&#x4F53;&#x53EF;&#x80FD;&#x6709;&#x5982;&#x4E0B;&#x539F;&#x56E0;&#xFF1A;</p>
<p>(1) &#x8FDE;&#x63A5;&#x6CC4;&#x9732; (&#x8F83;&#x4E3A;&#x5E38;&#x89C1;)</p>
<p>JedisPool&#x9ED8;&#x8BA4;&#x7684;maxTotal=8&#xFF0C;&#x4E0B;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x4ECE;JedisPool&#x4E2D;&#x501F;&#x4E86;8&#x6B21;Jedis&#xFF0C;&#x4F46;&#x662F;&#x6CA1;&#x6709;&#x5F52;&#x8FD8;&#xFF0C;&#x5F53;&#x7B2C;9&#x6B21;(jedisPool.getResource().ping())</p>
<pre class="language-"><code>GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
JedisPool jedisPool = new JedisPool(poolConfig, &quot;127.0.0.1&quot;, 6379);
//&#x5411;JedisPool&#x501F;&#x7528;8&#x6B21;&#x8FDE;&#x63A5;&#xFF0C;&#x4F46;&#x662F;&#x6CA1;&#x6709;&#x6267;&#x884C;&#x5F52;&#x8FD8;&#x64CD;&#x4F5C;&#x3002;
for (int i = 0; i &lt; 8; i++) {
    Jedis jedis = null;
    try {
        jedis = jedisPool.getResource();
        jedis.ping();
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
    }
}
jedisPool.getResource().ping();
</code></pre><p>&#x6240;&#x4EE5;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x7684;&#x4EE3;&#x7801;&#x89C4;&#x8303;&#x662F;&#xFF1A;</p>
<p>&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre class="language-"><code>Jedis jedis = null;
try {
    jedis = jedisPool.getResource();
    //&#x5177;&#x4F53;&#x7684;&#x547D;&#x4EE4;
    jedis.executeCommand()
} catch (Exception e) {
    //&#x5982;&#x679C;&#x547D;&#x4EE4;&#x6709;key&#x6700;&#x597D;&#x628A;key&#x4E5F;&#x5728;&#x9519;&#x8BEF;&#x65E5;&#x5FD7;&#x6253;&#x5370;&#x51FA;&#x6765;&#xFF0C;&#x5BF9;&#x4E8E;&#x96C6;&#x7FA4;&#x7248;&#x6765;&#x8BF4;&#x901A;&#x8FC7;key&#x53EF;&#x4EE5;&#x5E2E;&#x52A9;&#x5B9A;&#x4F4D;&#x5230;&#x5177;&#x4F53;&#x8282;&#x70B9;&#x3002;
    logger.error(e.getMessage(), e);
} finally {
    //&#x6CE8;&#x610F;&#x8FD9;&#x91CC;&#x4E0D;&#x662F;&#x5173;&#x95ED;&#x8FDE;&#x63A5;&#xFF0C;&#x5728;JedisPool&#x6A21;&#x5F0F;&#x4E0B;&#xFF0C;Jedis&#x4F1A;&#x88AB;&#x5F52;&#x8FD8;&#x7ED9;&#x8D44;&#x6E90;&#x6C60;&#x3002;
    if (jedis != null) 
        jedis.close();
}
</code></pre><p>(2) &#x4E1A;&#x52A1;&#x5E76;&#x53D1;&#x91CF;&#x5927;&#xFF0C;maxTotal&#x786E;&#x5B9E;&#x8BBE;&#x7F6E;&#x5C0F;&#x4E86;&#x3002;</p>
<p>&#x4E3E;&#x4E2A;&#x4F8B;&#x5B50;&#xFF1A;</p>
<ul>
<li>&#x4E00;&#x6B21;&#x547D;&#x4EE4;&#x65F6;&#x95F4;&#xFF08;borrow|return resource + Jedis&#x6267;&#x884C;&#x547D;&#x4EE4;(&#x542B;&#x7F51;&#x7EDC;) &#xFF09;&#x7684;&#x5E73;&#x5747;&#x8017;&#x65F6;&#x7EA6;&#x4E3A;1ms&#xFF0C;&#x4E00;&#x4E2A;&#x8FDE;&#x63A5;&#x7684;QPS&#x5927;&#x7EA6;&#x662F;1000</li>
<li>&#x4E1A;&#x52A1;&#x671F;&#x671B;&#x7684;QPS&#x662F;50000
&#x90A3;&#x4E48;&#x7406;&#x8BBA;&#x4E0A;&#x9700;&#x8981;&#x7684;&#x8D44;&#x6E90;&#x6C60;&#x5927;&#x5C0F;&#x662F;50000 / 1000 = 50&#x4E2A;&#xFF0C;&#x5B9E;&#x9645;maxTotal&#x53EF;&#x4EE5;&#x6839;&#x636E;&#x7406;&#x8BBA;&#x503C;&#x8FDB;&#x884C;&#x5FAE;&#x8C03;&#x3002;</li>
</ul>
<p>(3) Jedis&#x8FDE;&#x63A5;&#x8FD8;&#x7684;&#x592A;&#x6162;</p>
<p>&#x4F8B;&#x5982;Redis&#x53D1;&#x751F;&#x4E86;&#x963B;&#x585E;(&#x4F8B;&#x5982;&#x6162;&#x67E5;&#x8BE2;&#x7B49;&#x539F;&#x56E0;)&#xFF0C;&#x6240;&#x6709;&#x8FDE;&#x63A5;&#x5728;&#x8D85;&#x65F6;&#x65F6;&#x95F4;&#x8303;&#x56F4;&#x5185;&#x7B49;&#x5F85;&#xFF0C;&#x5E76;&#x53D1;&#x91CF;&#x8F83;&#x5927;&#x65F6;&#xFF0C;&#x4F1A;&#x9020;&#x6210;&#x8FDE;&#x63A5;&#x6C60;&#x8D44;&#x6E90;&#x4E0D;&#x8DB3;&#x3002;</p>
<p>(4) &#x5176;&#x4ED6;&#x95EE;&#x9898;</p>
<p>&#x4F8B;&#x5982;&#x4E22;&#x5305;&#x3001;DNS&#x3001;&#x5BA2;&#x6237;&#x7AEF;TCP&#x53C2;&#x6570;&#x914D;&#x7F6E;&#xFF0C;&#x5177;&#x4F53;&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#xFF1A;Jedis&#x4ECB;&#x7ECD;&#x53CA;&#x5E38;&#x89C1;&#x95EE;&#x9898;&#x5206;&#x6790;</p>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;</p>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x7A0D;&#x5FAE;&#x590D;&#x6742;&#x4E00;&#x4E9B;&#xFF0C;&#x4E0D;&#x8981;&#x88AB;&#x5F02;&#x5E38;&#x7684;&#x8868;&#x8C61;&#x6240;&#x8FF7;&#x60D1;&#xFF0C;&#x7B80;&#x5355;&#x5730;&#x8BA4;&#x4E3A;&#x8FDE;&#x63A5;&#x6C60;&#x4E0D;&#x591F;&#x5C31;&#x76F2;&#x76EE;&#x52A0;&#x5927;maxTotal&#xFF0C;&#x8981;&#x5177;&#x4F53;&#x95EE;&#x9898;&#x5177;&#x4F53;&#x5206;&#x6790;&#x3002;</p>
<p>&#x8FDE;&#x63A5;&#x6C60;&#x53C2;&#x6570;&#x4F18;&#x5316;&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#xFF1A;<a href="https://yq.aliyun.com/articles/236383?spm=a2c4e.11153940.0.0.9a9a407aHzKMoI" target="_blank">JedisPool&#x8D44;&#x6E90;&#x6C60;&#x4F18;&#x5316;</a></p>
<p>4.&#x5904;&#x7406;&#x4EBA;</p>
<p>&#x5BA2;&#x6237;&#x5148;&#x786E;&#x8BA4;&#xFF0C;&#x5982;&#x89E3;&#x51B3;&#x4E0D;&#x4E86;&#xFF0C;&#x9700;&#x8981;&#x501F;&#x52A9;&#x5DE5;&#x5355;&#x89E3;&#x51B3;</p>
<p><strong>&#x8FD8;&#x6709;&#x4E00;&#x79CD;&#x60C5;&#x51B5;&#x662F;</strong>&#xFF1A;&#x4ECE;&#x6C60;&#x5B50;&#x91CC;&#x62FF;&#x8FDE;&#x63A5;&#xFF0C;&#x7531;&#x4E8E;&#x6CA1;&#x6709;&#x7A7A;&#x95F2;&#x8FDE;&#x63A5;&#xFF0C;&#x9700;&#x8981;&#x91CD;&#x65B0;&#x751F;&#x6210;&#x4E00;&#x4E2A;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x4F46;&#x662F;&#x8FDE;&#x63A5;&#x88AB;&#x62D2;&#x7EDD;&#xFF1A;</p>
<pre class="language-"><code>redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
    at redis.clients.util.Pool.getResource(Pool.java:50)
    at redis.clients.jedis.JedisPool.getResource(JedisPool.java:99)
    at TestAdmin.main(TestAdmin.java:14)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused
    at redis.clients.jedis.Connection.connect(Connection.java:164)
    at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:80)
    at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1676)
    at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:87)
    at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861)
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
    at redis.clients.util.Pool.getResource(Pool.java:48)
    ... 2 more
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at redis.clients.jedis.Connection.connect(Connection.java:158)
    ... 9 more
</code></pre><p>&#x53EF;&#x4EE5;&#x4ECE;<code>at redis.clients.jedis.Connection.connect(Connection.java:158)</code>&#x770B;&#x5230;&#x5B9E;&#x9645;&#x662F;&#x4E00;&#x4E2A;Socket&#x8FDE;&#x63A5;&#xFF1A;</p>
<pre class="language-"><code> socket.setSoLinger(true, 0); // Control calls close () method,
        // the underlying socket is closed
        // immediately
        // &lt;-@wjw_add

158:  socket.connect(new InetSocketAddress(host, port), connectionTimeout);
</code></pre><p>&#x4E00;&#x822C;&#x8FD9;&#x79CD;&#x9700;&#x8981;&#x68C0;&#x67E5;Redis&#x7684;&#x57DF;&#x540D;&#x914D;&#x7F6E;&#x662F;&#x5426;&#x6B63;&#x786E;&#xFF0C;&#x6392;&#x67E5;&#x8BE5;&#x6BB5;&#x65F6;&#x95F4;&#x7F51;&#x7EDC;&#x662F;&#x5426;&#x6B63;&#x5E38;</p>
<h2 id="&#x4E8C;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x5F02;&#x5E38;"><a name="&#x4E8C;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x5F02;&#x5E38;" class="anchor-navigation-ex-anchor" href="#&#x4E8C;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x5F02;&#x5E38;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4E8C;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x5F02;&#x5E38;</h2>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream</p>
</blockquote>
<p>1.&#x5F02;&#x5E38;&#x5806;&#x6808;</p>
<pre class="language-"><code>redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
    at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:199)
    at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
    at redis.clients.jedis.Protocol.process(Protocol.java:151)
......
</code></pre><p>2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x8FD9;&#x4E2A;&#x5F02;&#x5E38;&#x662F;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x5F02;&#x5E38;&#xFF0C;&#x4EA7;&#x751F;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x53EF;&#x80FD;&#x6709;&#x4E09;&#x4E2A;&#x539F;&#x56E0;&#xFF1A;</p>
<p>(1) &#x5E38;&#x89C1;&#x539F;&#x56E0;&#xFF1A;&#x591A;&#x4E2A;&#x7EBF;&#x7A0B;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x6B63;&#x5E38;&#x7684;&#x60C5;&#x51B5;&#x662F;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;JedisPool&#x7BA1;&#x7406;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x5B9E;&#x73B0;&#x7EBF;&#x7A0B;&#x5B89;&#x5168;&#xFF0C;&#x9632;&#x6B62;&#x51FA;&#x73B0;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#xFF0C;&#x4F8B;&#x5982;&#x4E0B;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#x4E24;&#x4E2A;&#x7EBF;&#x7A0B;&#x7528;&#x4E86;&#x4E00;&#x4E2A;Jedis&#x8FDE;&#x63A5;&#xFF1A;</p>
<p>new Thread(new Runnable() {</p>
<pre class="language-"><code>public void run() {
    for (int i = 0; i &lt; 100; i++) {
        jedis.get(&quot;hello&quot;);
    }
}
</code></pre><p>}).start();</p>
<p>new Thread(new Runnable() {</p>
<pre class="language-"><code>public void run() {
    for (int i = 0; i &lt; 100; i++) {
        jedis.hget(&quot;haskey&quot;, &quot;f&quot;);
    }
}
</code></pre><p>}).start();
(2) &#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x6EE1;&#x4E86;</p>
<p>Redis&#x6709;&#x4E09;&#x79CD;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#xFF1A;</p>
<p>&#x666E;&#x901A;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;(normal)&#xFF1A;&#x7528;&#x4E8E;&#x63A5;&#x53D7;&#x666E;&#x901A;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x4F8B;&#x5982;get&#x3001;set&#x3001;mset&#x3001;hgetall&#x3001;zrange&#x7B49;
slave&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;(slave)&#xFF1A;&#x7528;&#x4E8E;&#x540C;&#x6B65;master&#x8282;&#x70B9;&#x7684;&#x5199;&#x547D;&#x4EE4;&#xFF0C;&#x5B8C;&#x6210;&#x590D;&#x5236;&#x3002;
&#x53D1;&#x5E03;&#x8BA2;&#x9605;&#x7F13;&#x51B2;&#x533A;(pubsub)&#xFF1A;pubsub&#x4E0D;&#x662F;&#x666E;&#x901A;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x56E0;&#x6B64;&#x6709;&#x5355;&#x72EC;&#x7684;&#x7F13;&#x51B2;&#x533A;&#x3002;
&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;</p>
<p>Redis&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x914D;&#x7F6E;&#x5177;&#x4F53;&#x683C;&#x5F0F;&#x662F;&#xFF1A;</p>
<p>client-output-buffer-limit <class> <hard limit=""> <soft limit=""> <soft seconds="">
(a) class: &#x5BA2;&#x6237;&#x7AEF;&#x7C7B;&#x578B;&#xFF1A;(a) normal&#x3001;(b) slave&#x3001;(c) pubsub</soft></soft></hard></class></p>
<p>(b) hard limit: &#x5982;&#x679C;&#x5BA2;&#x6237;&#x7AEF;&#x4F7F;&#x7528;&#x7684;&#x8F93;&#x51FA;&#x7F13;&#x51B2;&#x533A;&#x5927;&#x4E8E;hard limit&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x4F1A;&#x88AB;&#x7ACB;&#x5373;&#x5173;&#x95ED;&#x3002;</p>
<p>(c) soft limit&#x548C;soft seconds: &#x5982;&#x679C;&#x5BA2;&#x6237;&#x7AEF;&#x4F7F;&#x7528;&#x7684;&#x8F93;&#x51FA;&#x7F13;&#x51B2;&#x533A;&#x8D85;&#x8FC7;&#x4E86;soft limit&#x5E76;&#x4E14;&#x6301;&#x7EED;&#x4E86;soft limit&#x79D2;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x4F1A;&#x88AB;&#x7ACB;&#x5373;&#x5173;&#x95ED;</p>
<p>&#x4F8B;&#x5982;&#x4E0B;&#x9762;&#x662F;&#x4E00;&#x4EFD;Redis&#x7F13;&#x51B2;&#x533A;&#x7684;&#x914D;&#x7F6E;&#xFF0C;&#x6240;&#x4EE5;&#x5F53;&#x6761;&#x4EF6;&#x6EE1;&#x8DB3;&#x65F6;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x8FDE;&#x63A5;&#x4F1A;&#x88AB;&#x5173;&#x95ED;&#xFF0C;&#x5C31;&#x4F1A;&#x51FA;&#x73B0;Unexpected end of stream&#x3002;</p>
<p>redis&gt; config get client-output-buffer-limit
1) &quot;client-output-buffer-limit&quot;
2) &quot;normal 524288000 0 0 slave 2147483648 536870912 480 pubsub 33554432 8388608 60&quot;
(3) &#x957F;&#x65F6;&#x95F4;&#x95F2;&#x7F6E;&#x8FDE;&#x63A5;&#x88AB;&#x670D;&#x52A1;&#x7AEF;&#x4E3B;&#x52A8;&#x65AD;&#x5F00;&#xFF0C;&#x53EF;&#x4EE5;&#x67E5;&#x8BE2;timeout&#x914D;&#x7F6E;&#x7684;&#x8BBE;&#x7F6E;&#x4EE5;&#x53CA;&#x81EA;&#x8EAB;&#x8FDE;&#x63A5;&#x6C60;&#x914D;&#x7F6E;&#x662F;&#x5426;&#x9700;&#x8981;&#x505A;&#x7A7A;&#x95F2;&#x68C0;&#x6D4B;&#x3002;</p>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x548C;&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x5BA2;&#x6237;&#xFF1A;&#x6392;&#x67E5;&#x81EA;&#x8EAB;&#x4EE3;&#x7801;&#x662F;&#x5426;&#x4F7F;&#x7528;JedisPool&#x7BA1;&#x7406;Jedis&#x8FDE;&#x63A5;&#xFF0C;&#x662F;&#x5426;&#x5B58;&#x5728;&#x5E76;&#x53D1;&#x64CD;&#x4F5C;Jedis&#x7684;&#x60C5;&#x51B5;&#x3002;</p>
<p>&#x5DE5;&#x5355;: &#x6392;&#x67E5;(2)(3)&#xFF0C;&#x963F;&#x91CC;&#x4E91;Redis&#x4E2D;timeout=0&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x4E0D;&#x4F1A;&#x4E3B;&#x52A8;&#x5173;&#x95ED;&#x7A7A;&#x95F2;&#x8FDE;&#x63A5;&#xFF0C;&#x7F13;&#x51B2;&#x533A;&#x8BBE;&#x7F6E;&#x4E3A;0 0 0 &#x4E5F;&#x5C31;&#x662F;&#x4E0D;&#x4F1A;&#x5BF9;&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x8FDB;&#x884C;&#x9650;&#x5236;&#xFF0C;&#x4E00;&#x822C;&#x4E0D;&#x4F1A;&#x6709;&#x95EE;&#x9898;</p>
<p>&#x4E09;&#x3001;&#x975E;&#x6CD5;&#x5BA2;&#x6237;&#x7AEF;&#x5730;&#x5740; &#xFF08;&#x963F;&#x91CC;&#x4E91;Redis&#x63D0;&#x4F9B;&#x5BA2;&#x6237;&#x7AEF;&#x767D;&#x540D;&#x5355;&#x529F;&#x80FD;&#xFF09;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: ERR illegal address
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR illegal address
    at redis.clients.jedis.Protocol.processError(Protocol.java:117)
    at redis.clients.jedis.Protocol.process(Protocol.java:151)
    at redis.clients.jedis.Protocol.read(Protocol.java:205)
    ......
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
Redis&#x5B9E;&#x4F8B;&#x914D;&#x7F6E;&#x4E86;&#x767D;&#x540D;&#x5355;&#xFF0C;&#x4F46;&#x5F53;&#x524D;&#x8BBF;&#x95EE;Redis&#x7684;&#x5BA2;&#x6237;&#x7AEF;(IP)&#x4E0D;&#x5728;&#x767D;&#x540D;&#x5355;&#x4E2D;&#x3002;</p>
</blockquote>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x6DFB;&#x52A0;&#x8BE5;&#x5BA2;&#x6237;&#x7AEF;(IP)&#x7684;&#x767D;&#x540D;&#x5355;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;
&#x5BA2;&#x6237;&#x6216;&#x8005;&#x5DE5;&#x5355;&#x90FD;&#x53EF;&#x4EE5;</p>
<p>&#x56DB;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x8FDE;&#x63A5;&#x6570;&#x8FBE;&#x5230;&#x6700;&#x5927;&#x503C;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: ERR max number of clients reached
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
redis.clients.jedis.exceptions.JedisDataException: ERR max number of clients reached
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x5982;&#x679C;&#x5BA2;&#x6237;&#x7AEF;&#x8FDE;&#x63A5;&#x6570;&#x8D85;&#x8FC7;&#x4E86;Redis&#x5B9E;&#x4F8B;&#x914D;&#x7F6E;&#x7684;&#x6700;&#x5927;maxclients</p>
</blockquote>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x63D0;&#x5DE5;&#x5355;&#x5E2E;&#x52A9;&#x4E34;&#x65F6;&#x8C03;&#x5927;&#x6700;&#x5927;&#x8FDE;&#x63A5;&#x6570;&#xFF0C;&#x5E76;&#x8BA9;&#x5BA2;&#x6237;&#x627E;&#x5230;&#x8FDE;&#x63A5;&#x6570;&#x66B4;&#x6DA8;&#x7684;&#x539F;&#x56E0;(&#x56E0;&#x4E3A;&#x4E0A;&#x8FF0;&#x8C03;&#x6574;&#x53EA;&#x662F;&#x4E34;&#x65F6;&#x8C03;&#x6574;)&#xFF0C;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;
&#x5DE5;&#x5355;&#xFF1A;&#x4E34;&#x65F6;&#x8C03;&#x6574;&#x6700;&#x5927;&#x8FDE;&#x63A5;&#x6570;&#xFF0C;&#x534F;&#x52A9;&#x5B9A;&#x4F4D;&#x95EE;&#x9898;
&#x5BA2;&#x6237;&#xFF1A;&#x5B9A;&#x4F4D;&#x81EA;&#x8EAB;&#x95EE;&#x9898;(&#x53EF;&#x4EE5;&#x5B9A;&#x4F4D;&#x8FDE;&#x63A5;&#x6700;&#x591A;&#x7684;&#x5BA2;&#x6237;&#x7AEF;)&#xFF0C;&#x627E;&#x5230;&#x95EE;&#x9898;&#x539F;&#x56E0;&#xFF08;&#x4F8B;&#x5982;&#x8FDE;&#x63A5;&#x6C60;&#x914D;&#x7F6E;&#x7B49;&#xFF09;</p>
<p>&#x4E94;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x8BFB;&#x5199;&#x8D85;&#x65F6;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x8BE5;&#x95EE;&#x9898;&#x539F;&#x56E0;&#x53EF;&#x80FD;&#x6709;&#x5982;&#x4E0B;&#x51E0;&#x79CD;&#xFF1A;
(1) &#x8BFB;&#x5199;&#x8D85;&#x65F6;&#x8BBE;&#x7F6E;&#x7684;&#x8FC7;&#x77ED;&#x3002;
(2) &#x6709;&#x6162;&#x67E5;&#x8BE2;&#x6216;&#x8005;Redis&#x53D1;&#x751F;&#x963B;&#x585E;&#x3002;
(3) &#x7F51;&#x7EDC;&#x4E0D;&#x7A33;&#x5B9A;&#x3002;</p>
</blockquote>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x5BA2;&#x6237;&#x63D0;&#x4F9B;&#x8BFB;&#x5199;&#x8D85;&#x65F6;&#x65F6;&#x95F4;&#xFF0C;&#x63D0;&#x4EA4;&#x5DE5;&#x5355;&#x5B9A;&#x4F4D;&#x76F8;&#x5173;&#x539F;&#x56E0;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x5DE5;&#x5355;&#x3002;</p>
<p>&#x516D;&#x3001;&#x5BC6;&#x7801;&#x76F8;&#x5173;&#x7684;&#x5F02;&#x5E38;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
Redis&#x8BBE;&#x7F6E;&#x4E86;&#x5BC6;&#x7801;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x8BF7;&#x6C42;&#x6CA1;&#x4F20;&#x5BC6;&#x7801;&#xFF1A;</p>
</blockquote>
<p>Exception in thread &quot;main&quot; redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
     at redis.clients.jedis.Protocol.processError(Protocol.java:127)
     at redis.clients.jedis.Protocol.process(Protocol.java:161)
     at redis.clients.jedis.Protocol.read(Protocol.java:215)
Redis&#x6CA1;&#x6709;&#x8BBE;&#x7F6E;&#x5BC6;&#x7801;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x4F20;&#x4E86;&#x5BC6;&#x7801;&#xFF1A;</p>
<p>Exception in thread &quot;main&quot; redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
     at redis.clients.jedis.Protocol.processError(Protocol.java:127)
     at redis.clients.jedis.Protocol.process(Protocol.java:161)
     at redis.clients.jedis.Protocol.read(Protocol.java:215)
&#x5BA2;&#x6237;&#x7AEF;&#x4F20;&#x4E86;&#x9519;&#x8BEF;&#x7684;&#x5BC6;&#x7801;&#xFF1A;</p>
<p>redis.clients.jedis.exceptions.JedisDataException: ERR invalid password
    at redis.clients.jedis.Protocol.processError(Protocol.java:117)
    at redis.clients.jedis.Protocol.process(Protocol.java:151)
    at redis.clients.jedis.Protocol.read(Protocol.java:205)
2.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;&#x5F04;&#x6E05;&#x695A;&#x5230;&#x5E95;&#x6709;&#x6CA1;&#x6709;&#x5BC6;&#x7801;&#xFF0C;&#x5BC6;&#x7801;&#x662F;&#x5426;&#x6B63;&#x786E;&#x3002;</p>
<p>&#x4E03;&#x3001;&#x4E8B;&#x52A1;&#x5F02;&#x5E38;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: EXECABORT Transaction discarded because of previous errors
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
redis.clients.jedis.exceptions.JedisDataException: EXECABORT Transaction discarded because of previous errors
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x8FD9;&#x4E2A;&#x662F;Redis&#x7684;&#x4E8B;&#x52A1;&#x5F02;&#x5E38;&#xFF1A;&#x4E8B;&#x52A1;&#x4E2D;&#x5305;&#x542B;&#x4E86;&#x9519;&#x8BEF;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x4F8B;&#x5982;&#x5982;&#x4E0B;sett&#x662F;&#x4E2A;&#x4E0D;&#x5B58;&#x5728;&#x7684;&#x547D;&#x4EE4;&#x3002;</p>
</blockquote>
<p>127.0.0.1:6379&gt; multi
OK
127.0.0.1:6379&gt; sett key world
(error) ERR unknown command &apos;sett&apos;
127.0.0.1:6379&gt; incr counter
QUEUED
127.0.0.1:6379&gt; exec
(error) EXECABORT Transaction discarded because of previous errors.
3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x548C;&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x5BA2;&#x6237;&#x4FEE;&#x590D;&#x81EA;&#x8EAB;&#x4EE3;&#x7801;&#x9519;&#x8BEF;&#x3002;</p>
<p>&#x516B;&#x3001;&#x7C7B;&#x8F6C;&#x6362;&#x9519;&#x8BEF;</p>
<blockquote>
<p>java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.List
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.List
         at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:199)
         at redis.clients.jedis.Jedis.hgetAll(Jedis.java:851)
         at redis.clients.jedis.ShardedJedis.hgetAll(ShardedJedis.java:198)<br>java.lang.ClassCastException: java.util.ArrayList cannot be cast to [B
         at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:182)
         at redis.clients.jedis.Connection.getBulkReply(Connection.java:171)
         at redis.clients.jedis.Jedis.rpop(Jedis.java:1109)
         at redis.clients.jedis.ShardedJedis.rpop(ShardedJedis.java:258)
.......
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
Jedis&#x6B63;&#x786E;&#x7684;&#x4F7F;&#x7528;&#x65B9;&#x6CD5;&#x662F;&#xFF1A;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x64CD;&#x4F5C;&#x4E00;&#x4E2A;Jedis&#xFF0C;&#x901A;&#x5E38;&#x6765;&#x8BB2;&#x4EA7;&#x751F;&#x8BE5;&#x9519;&#x8BEF;&#x662F;&#x7531;&#x4E8E;&#x6CA1;&#x6709;&#x4F7F;&#x7528;JedisPool&#x9020;&#x6210;&#x7684;&#xFF0C;&#x4F8B;&#x5982;&#x5982;&#x4E0B;&#x4EE3;&#x7801;&#x5728;&#x4E24;&#x4E2A;&#x7EBF;&#x7A0B;&#x5E76;&#x53D1;&#x4F7F;&#x7528;&#x4E86;&#x4E00;&#x4E2A;Jedis&#x3002;(get&#x3001;hgetAll&#x8FD4;&#x56DE;&#x7C7B;&#x578B;&#x4E5F;&#x662F;&#x4E0D;&#x4E00;&#x6837;&#x7684;)</p>
</blockquote>
<p>new Thread(new Runnable() {</p>
<pre class="language-"><code>public void run() {
    for (int i = 0; i &lt; 100; i++) {
        jedis.set(&quot;hello&quot;, &quot;world&quot;);
        jedis.get(&quot;hello&quot;);
    }
}
</code></pre><p>}).start();</p>
<p>new Thread(new Runnable() {</p>
<pre class="language-"><code>public void run() {
    for (int i = 0; i &lt; 100; i++) {
        jedis.hset(&quot;hashkey&quot;, &quot;f&quot;, &quot;v&quot;);
        jedis.hgetAll(&quot;hashkey&quot;);
    }
}
</code></pre><p>}).start();
3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x548C;&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x5BA2;&#x6237;&#x6392;&#x67E5;&#x81EA;&#x8EAB;&#x4EE3;&#x7801;&#x662F;&#x5426;&#x5B58;&#x5728;&#x4E0A;&#x8FF0;&#x95EE;&#x9898;</p>
<p>&#x4E5D;&#x3001;&#x547D;&#x4EE4;&#x4F7F;&#x7528;&#x9519;&#x8BEF;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
Exception in thread &quot;main&quot; redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value
    at redis.clients.jedis.Protocol.processError(Protocol.java:127)
    at redis.clients.jedis.Protocol.process(Protocol.java:161)
    at redis.clients.jedis.Protocol.read(Protocol.java:215)
.....
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x4F8B;&#x5982;key=&quot;hello&quot;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x7684;&#x952E;&#xFF0C;&#x800C;hgetAll&#x662F;&#x54C8;&#x5E0C;&#x7C7B;&#x578B;&#x7684;&#x952E;&#xFF0C;&#x6240;&#x4EE5;&#x51FA;&#x73B0;&#x4E86;&#x9519;&#x8BEF;&#x3002;</p>
</blockquote>
<p>jedis.set(&quot;hello&quot;,&quot;world&quot;);
jedis.hgetAll(&quot;hello&quot;);
3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x548C;&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x8BF7;&#x5BA2;&#x6237;&#x4FEE;&#x6539;&#x81EA;&#x8EAB;&#x4EE3;&#x7801;&#x9519;&#x8BEF;&#x3002;</p>
<p>&#x5341;&#x3001;Redis&#x4F7F;&#x7528;&#x7684;&#x5185;&#x5B58;&#x8D85;&#x8FC7;maxmemory&#x914D;&#x7F6E;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: OOM command not allowed when used memory &gt; &apos;maxmemory&apos;
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
redis.clients.jedis.exceptions.JedisDataException: OOM command not allowed when used memory &gt; &apos;maxmemory&apos;.
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
Redis&#x8282;&#x70B9;(&#x5982;&#x679C;&#x662F;&#x96C6;&#x7FA4;&#xFF0C;&#x5219;&#x662F;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x8282;&#x70B9;)&#x4F7F;&#x7528;&#x5927;&#x4E8E;&#x8BE5;&#x5B9E;&#x4F8B;&#x7684;&#x5185;&#x5B58;&#x89C4;&#x683C;(maxmemory&#x914D;&#x7F6E;)&#x3002;</p>
</blockquote>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x539F;&#x56E0;&#x53EF;&#x80FD;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x4E2A;&#xFF1A;</p>
<p>&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x6B63;&#x5E38;&#x589E;&#x52A0;
&#x5BA2;&#x6237;&#x7AEF;&#x7F13;&#x51B2;&#x533A;&#x5F02;&#x5E38;&#xFF1A;&#x4F8B;&#x5982;&#x4F7F;&#x7528;&#x4E86;monitor&#x3001;pub/sub&#x4F7F;&#x7528;&#x4E0D;&#x5F53;&#x7B49;&#x7B49;
&#x7EAF;&#x7F13;&#x5B58;&#x4F7F;&#x7528;&#x573A;&#x666F;&#xFF0C;&#x4F46;&#x662F;maxmemory-policy&#x914D;&#x7F6E;&#x6709;&#x8BEF;(&#x4F8B;&#x5982;&#x6CA1;&#x6709;&#x8FC7;&#x671F;&#x952E;&#x7684;&#x4E1A;&#x52A1;&#x914D;&#x7F6E;volatile-lru)
&#x7D27;&#x6025;&#x5904;&#x7406;&#xFF0C;&#x53EF;&#x4EE5;&#x4E34;&#x65F6;&#x63D0;&#x5DE5;&#x5355;&#x5E2E;&#x52A9;&#x4E34;&#x65F6;&#x8C03;&#x6574;maxmeory&#xFF0C;&#x540E;&#x7EED;&#x54A8;&#x8BE2;&#x7528;&#x6237;&#x662F;&#x5426;&#x5347;&#x914D;&#x6216;&#x8005;&#x8C03;&#x6574;&#x914D;&#x7F6E;&#x3002;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;
&#x5BA2;&#x6237;&#xFF1A;&#x627E;&#x5230;&#x5185;&#x5B58;&#x589E;&#x5927;&#x7684;&#x539F;&#x56E0;&#x3002;
&#x5DE5;&#x5355;&#xFF1A;&#x534F;&#x52A9;&#x4E34;&#x65F6;&#x8C03;&#x6574;maxmeomry&#xFF0C;&#x5982;&#x679C;&#x5BA2;&#x6237;&#x9700;&#x8981;&#xFF0C;&#x53EF;&#x4EE5;&#x534F;&#x52A9;&#x89E3;&#x51B3;</p>
<p>&#x5341;&#x4E00;&#x3001;Redis&#x6B63;&#x5728;&#x52A0;&#x8F7D;&#x6301;&#x4E45;&#x5316;&#x6587;&#x4EF6;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: LOADING Redis is loading the dataset in memory
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
redis.clients.jedis.exceptions.JedisDataException: LOADING Redis is loading the dataset in memory
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
Jedis&#x8C03;&#x7528;Redis&#x65F6;&#xFF0C;&#x5982;&#x679C;Redis&#x6B63;&#x5728;&#x52A0;&#x8F7D;&#x6301;&#x4E45;&#x5316;&#x6587;&#x4EF6;&#xFF0C;&#x65E0;&#x6CD5;&#x8FDB;&#x884C;&#x6B63;&#x5E38;&#x7684;&#x8BFB;&#x5199;&#x3002;</p>
</blockquote>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x6B63;&#x5E38;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x963F;&#x91CC;&#x4E91;Redis&#x4E0D;&#x4F1A;&#x51FA;&#x73B0;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#xFF0C;&#x5982;&#x679C;&#x51FA;&#x73B0;&#xFF0C;&#x5219;&#x63D0;&#x4EA4;&#x5DE5;&#x5355;&#x5904;&#x7406;&#x3002;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x5DE5;&#x5355;&#x3002;</p>
<p>&#x5341;&#x4E8C;&#x3001;Lua&#x811A;&#x672C;&#x8D85;&#x65F6;
1.&#x5F02;&#x5E38;&#x5806;&#x6808;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.</p>
</blockquote>
<p>2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;</p>
<p>&#x5982;&#x679C;Redis&#x5F53;&#x524D;&#x6B63;&#x5728;&#x6267;&#x884C;Lua&#x811A;&#x672C;&#xFF0C;&#x5E76;&#x4E14;&#x8D85;&#x8FC7;&#x4E86;lua-time-limit&#xFF0C;&#x6B64;&#x65F6;Jedis&#x8C03;&#x7528;Redis&#x65F6;&#xFF0C;&#x4F1A;&#x6536;&#x5230;&#x4E0B;&#x9762;&#x7684;&#x5F02;&#x5E38;</p>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x6309;&#x7167;&#x5F02;&#x5E38;&#x63D0;&#x793A;&#xFF1A;You can only call SCRIPT KILL or SHUTDOWN NOSAVE. (&#x4F7F;&#x7528;script kill:kill&#x6389;Lua&#x811A;&#x672C;)</p>
<p>4.&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x6700;&#x597D;&#x5BA2;&#x6237;&#x81EA;&#x5DF1;&#x5904;&#x7406;&#xFF0C;&#x5982;&#x679C;&#x89E3;&#x51B3;&#x4E0D;&#x4E86;&#xFF0C;&#x503C;&#x73ED;&#x4EBA;&#x5458;&#x53EF;&#x4EE5;&#x534F;&#x52A9;&#x64CD;&#x4F5C;&#x3002;</p>
<p>&#x5341;&#x4E09; &#x8FDE;&#x63A5;&#x8D85;&#x65F6;</p>
<p>1.&#x5F02;&#x5E38;&#x5806;&#x6808;</p>
<p>redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x53EF;&#x80FD;&#x4EA7;&#x751F;&#x7684;&#x539F;&#x56E0;&#xFF1A;</p>
<p>&#x8FDE;&#x63A5;&#x8D85;&#x65F6;&#x8BBE;&#x7F6E;&#x7684;&#x8FC7;&#x77ED;&#x3002;
tcp-backlog&#x6EE1;&#xFF0C;&#x9020;&#x6210;&#x65B0;&#x7684;&#x8FDE;&#x63A5;&#x5931;&#x8D25;&#x3002;
&#x5BA2;&#x6237;&#x7AEF;&#x4E0E;&#x670D;&#x52A1;&#x7AEF;&#x7F51;&#x7EDC;&#x4E0D;&#x6B63;&#x5E38;&#x3002;
3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x5BA2;&#x6237;&#x63D0;&#x4F9B;&#x8FDE;&#x63A5;&#x8D85;&#x65F6;&#x65F6;&#x95F4;&#xFF0C;&#x63D0;&#x4EA4;&#x5DE5;&#x5355;&#x5B9A;&#x4F4D;&#x76F8;&#x5173;&#x539F;&#x56E0;&#x3002;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x5DE5;&#x5355;&#x3002;</p>
<p>&#x5341;&#x56DB; Lua&#x811A;&#x672C;&#x5199;&#x8D85;&#x65F6;</p>
<p>1.&#x5F02;&#x5E38;&#x5806;&#x6808;
(error) UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x5982;&#x679C;Redis&#x5F53;&#x524D;&#x6B63;&#x5728;&#x6267;&#x884C;Lua&#x811A;&#x672C;&#xFF0C;&#x5E76;&#x4E14;&#x8D85;&#x8FC7;&#x4E86;lua-time-limit&#xFF0C;&#x5E76;&#x4E14;&#x5DF2;&#x7ECF;&#x6267;&#x884C;&#x8FC7;&#x5199;&#x547D;&#x4EE4;&#xFF0C;&#x6B64;&#x65F6;Jedis&#x8C03;&#x7528;Redis&#x65F6;&#xFF0C;&#x4F1A;&#x6536;&#x5230;&#x4E0A;&#x9762;&#x7684;&#x5F02;&#x5E38;</p>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x63D0;&#x4EA4;&#x5DE5;&#x5355;&#x505A;&#x7D27;&#x6025;&#x5904;&#x7406;&#xFF0C;&#x7BA1;&#x7406;&#x5458;&#x8981;&#x505A;&#x91CD;&#x542F;&#x6216;&#x8005;&#x5207;&#x6362;Redis&#x8282;&#x70B9;&#x3002;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x5DE5;&#x5355;&#x3002;</p>
<p>&#x5341;&#x4E94;&#x3001;&#x7C7B;&#x52A0;&#x8F7D;&#x9519;&#x8BEF;</p>
<blockquote>
<p>java.lang.NoClassDefFoundError</p>
</blockquote>
<p>1.&#x5F02;&#x5E38;&#x5806;&#x6808;</p>
<p>&#x4F8B;&#x5982;&#x627E;&#x4E0D;&#x5230;&#x7C7B;&#x548C;&#x65B9;&#x6CD5;&#xFF1A;</p>
<p>Exception in thread &quot;commons-pool-EvictionTimer&quot; java.lang.NoClassDefFoundError: redis/clients/util/IOUtils
    at redis.clients.jedis.Connection.disconnect(Connection.java:226)
    at redis.clients.jedis.BinaryClient.disconnect(BinaryClient.java:941)
    at redis.clients.jedis.BinaryJedis.disconnect(BinaryJedis.java:1771)
    at redis.clients.jedis.JedisFactory.destroyObject(JedisFactory.java:91)
    at         org.apache.commons.pool2.impl.GenericObjectPool.destroy(GenericObjectPool.java:897)
    at org.apache.commons.pool2.impl.GenericObjectPool.evict(GenericObjectPool.java:793)
    at org.apache.commons.pool2.impl.BaseGenericObjectPool$Evictor.run(BaseGenericObjectPool.java:1036)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.ClassNotFoundException: redis.clients.util.IOUtils
......
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x8FD0;&#x884C;&#x65F6;&#xFF0C;Jedis&#x6267;&#x884C;&#x547D;&#x4EE4;&#xFF0C;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#xFF1A;&#x67D0;&#x4E2A;&#x7C7B;&#x627E;&#x4E0D;&#x5230;&#x3002;&#x4E00;&#x822C;&#x6B64;&#x7C7B;&#x95EE;&#x9898;&#x90FD;&#x662F;&#x7531;&#x4E8E;&#x52A0;&#x8F7D;&#x591A;&#x4E2A;jedis&#x7248;&#x672C;(&#x4F8B;&#x5982;jedis 2.9.0&#x548C;jedis 2.6)&#xFF0C;&#x5728;&#x7F16;&#x8BD1;&#x671F;&#x4EE3;&#x7801;&#x672A;&#x51FA;&#x73B0;&#x95EE;&#x9898;&#xFF0C;&#x4F46;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x5728;&#x8FD0;&#x884C;&#x65F6;&#x52A0;&#x8F7D;&#x4E86;&#x4F4E;&#x7248;&#x672C;&#x7684;Jedis&#xFF0C;&#x9020;&#x6210;&#x8FD0;&#x884C;&#x65F6;&#x627E;&#x4E0D;&#x5230;&#x7C7B;&#x3002;</p>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x901A;&#x5E38;&#x6B64;&#x7C7B;&#x95EE;&#x9898;&#xFF0C;&#x53EF;&#x4EE5;&#x5C06;&#x91CD;&#x590D;&#x7684;jedis&#x6392;&#x9664;&#x6389;&#xFF0C;&#x4F8B;&#x5982;&#x5229;&#x7528;maven&#x7684;&#x4F9D;&#x8D56;&#x6811;&#xFF0C;&#x628A;&#x65E0;&#x7528;&#x7684;&#x4F9D;&#x8D56;&#x53BB;&#x6389;&#x6216;&#x8005;exclusion&#x6389;&#x3002;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;
&#x5BA2;&#x6237;&#x6392;&#x67E5;&#x81EA;&#x8EAB;&#x4EE3;&#x7801;</p>
<p>&#x5341;&#x516D;&#x3001;&#x670D;&#x52A1;&#x7AEF;&#x547D;&#x4EE4;&#x4E0D;&#x652F;&#x6301;</p>
<blockquote>
<p>redis.clients.jedis.exceptions.JedisDataException: ERR unknown command</p>
</blockquote>
<p>1.&#x5F02;&#x5E38;&#x5806;&#x6808;
&#x4F8B;&#x5982;&#x5BA2;&#x6237;&#x7AEF;&#x6267;&#x884C;&#x4E86;geoadd&#x547D;&#x4EE4;&#xFF0C;&#x4F46;&#x662F;&#x670D;&#x52A1;&#x7AEF;&#x8FD4;&#x56DE;&#x4E0D;&#x652F;&#x6301;&#x6B64;&#x547D;&#x4EE4;</p>
<p>redis.clients.jedis.exceptions.JedisDataException: ERR unknown command &apos;GEOADD&apos;
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x8BE5;&#x547D;&#x4EE4;&#x4E0D;&#x80FD;&#x88AB;Redis&#x7AEF;&#x8BC6;&#x522B;&#xFF0C;&#x6709;&#x53EF;&#x80FD;&#x6709;&#x4E24;&#x4E2A;&#x539F;&#x56E0;&#xFF1A;</p>
<p>&#x793E;&#x533A;&#x7248;&#x7684;&#x4E00;&#x4E9B;&#x547D;&#x4EE4;&#xFF0C;&#x963F;&#x91CC;&#x4E91;Redis&#x7684;&#x4E0D;&#x652F;&#x6301;&#xFF0C;&#x6216;&#x8005;&#x53EA;&#x5728;&#x67D0;&#x4E9B;&#x5C0F;&#x7248;&#x672C;&#x4E0A;&#x652F;&#x6301;(&#x4F8B;&#x5982;geoadd&#x662F;Redis 3.2&#x6DFB;&#x52A0;&#x7684;&#x5730;&#x7406;&#x4FE1;&#x606F;api)&#x3002;
&#x547D;&#x4EE4;&#x672C;&#x8EAB;&#x662F;&#x9519;&#x8BEF;&#x7684;(&#x4E0D;&#x8FC7;&#x5BF9;&#x4E8E;Jedis&#x6765;&#x8BF4;&#x8FD8;&#x597D;&#xFF0C;&#x4E0D;&#x652F;&#x6301;&#x76F4;&#x63A5;&#x7EC4;&#x88C5;&#x547D;&#x4EE4;&#xFF0C;&#x6BCF;&#x4E2A;API&#x90FD;&#x6709;&#x56FA;&#x5B9A;&#x7684;&#x51FD;&#x6570;)&#x3002;
3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x54A8;&#x8BE2;&#x662F;&#x5426;&#x6709;Redis&#x7248;&#x672C;&#x652F;&#x6301;&#x8BE5;&#x547D;&#x4EE4;&#xFF0C;&#x5982;&#x652F;&#x6301;&#x53EF;&#x4EE5;&#x8BA9;&#x5BA2;&#x6237;&#x505A;&#x5C0F;&#x7248;&#x672C;&#x5347;&#x7EA7;&#x3002;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;
&#x7BA1;&#x7406;&#x5458;&#xFF1A;&#x786E;&#x8BA4;&#x7248;&#x672C;&#x662F;&#x5426;&#x652F;&#x6301;&#x8BE5;&#x547D;&#x4EE4;
&#x5BA2;&#x6237;&#xFF1A;&#x786E;&#x8BA4;&#x540E;&#xFF0C;&#x505A;&#x5C0F;&#x7248;&#x672C;&#x5347;&#x7EA7;</p>
<p>&#x5341;&#x4E03;&#x3001;pipeline&#x9519;&#x8BEF;&#x4F7F;&#x7528;
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
redis.clients.jedis.exceptions.JedisDataException: Please close pipeline or multi block before calling this method.
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x5728;pipeline.sync()&#x6267;&#x884C;&#x4E4B;&#x524D;&#xFF0C;&#x901A;&#x8FC7;response.get()&#x83B7;&#x53D6;&#x503C;&#xFF0C;&#x5728;pipeline.sync()&#x6267;&#x884C;&#x524D;&#xFF0C;&#x547D;&#x4EE4;&#x6CA1;&#x6709;&#x6267;&#x884C;(&#x53EF;&#x4EE5;&#x901A;&#x8FC7;monitor&#x505A;&#x9A8C;&#x8BC1;)&#xFF0C;&#x4E0B;&#x9762;&#x4EE3;&#x7801;&#x5C31;&#x4F1A;&#x5F15;&#x8D77;&#x4E0A;&#x8FF0;&#x5F02;&#x5E38;</p>
<p>Jedis jedis = new Jedis(&quot;127.0.0.1&quot;, 6379);
Pipeline pipeline = jedis.pipelined();
pipeline.set(&quot;hello&quot;, &quot;world&quot;); 
pipeline.set(&quot;java&quot;, &quot;jedis&quot;);</p>
<p>Response<string> pipeString = pipeline.get(&quot;java&quot;);
//&#x8FD9;&#x4E2A;get&#x5FC5;&#x987B;&#x5728;sync&#x4E4B;&#x540E;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x6279;&#x91CF;&#x83B7;&#x53D6;&#x503C;&#x5EFA;&#x8BAE;&#x76F4;&#x63A5;&#x7528;List<object> objectList = pipeline.syncAndReturnAll();
System.out.println(pipeString.get());
//&#x547D;&#x4EE4;&#x6B64;&#x65F6;&#x771F;&#x6B63;&#x6267;&#x884C;
pipeline.sync();
Jedis&#x4E2D;Reponse&#x4E2D;get()&#x65B9;&#x6CD5;&#xFF0C;&#x6709;&#x4E2A;&#x5224;&#x65AD;:&#x5982;&#x679C;set=false&#x5C31;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x800C;response&#x4E2D;&#x7684;set&#x521D;&#x59CB;&#x5316;&#x4E3A;false.</object></string></p>
<p>public T get() {
  // if response has dependency response and dependency is not built,
  // build it first and no more!!
  if (dependency != null &amp;&amp; dependency.set &amp;&amp; !dependency.built) {
    dependency.build();
  }
  if (!set) {
    throw new JedisDataException(
        &quot;Please close pipeline or multi block before calling this method.&quot;);
  }
  if (!built) {
    build();
  }
  if (exception != null) {
    throw exception;
  }
  return response;
}
pipeline.sync()&#x4F1A;&#x6BCF;&#x4E2A;&#x7ED3;&#x679C;&#x8BBE;&#x7F6E;set=true&#x3002;</p>
<p>public void sync() {
  if (getPipelinedResponseLength() &gt; 0) {
    List<object> unformatted = client.getAll();
    for (Object o : unformatted) {
      generateResponse(o);
    }
  }
}
&#x5176;&#x4E2D;generateResponse(o):</object></p>
<p>protected Response&lt;?&gt; generateResponse(Object data) {
  Response&lt;?&gt; response = pipelinedResponses.poll();
  if (response != null) {
    response.set(data);
  }
  return response;
}
&#x5176;&#x4E2D;response.set(data);</p>
<p>public void set(Object data) {
    this.data = data;
    set = true;
}
3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x5B9E;&#x9645;&#x4E0A;&#x5BF9;&#x4E8E;&#x6279;&#x91CF;&#x7ED3;&#x679C;&#x7684;&#x89E3;&#x6790;&#xFF0C;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;pipeline.syncAndReturnAll()&#x6765;&#x5B9E;&#x73B0;&#xFF0C;&#x4E0B;&#x9762;&#x64CD;&#x4F5C;&#x6A21;&#x62DF;&#x4E86;&#x6279;&#x91CF;hgetAll</p>
<p>/**</p>
<ul>
<li>pipeline&#x6A21;&#x62DF;&#x6279;&#x91CF;hgetAll</li>
<li>@param keyList</li>
<li>@return
*/
public Map<string, map<string,="" string="">&gt; mHgetAll(List<string> keyList) {
// 1.&#x751F;&#x6210;pipeline&#x5BF9;&#x8C61;
Pipeline pipeline = jedis.pipelined();
// 2.pipeline&#x6267;&#x884C;&#x547D;&#x4EE4;&#xFF0C;&#x6CE8;&#x610F;&#x6B64;&#x65F6;&#x547D;&#x4EE4;&#x5E76;&#x672A;&#x771F;&#x6B63;&#x6267;&#x884C;
for (String key : keyList) {
pipeline.hgetAll(key);
}
// 3.&#x6267;&#x884C;&#x547D;&#x4EE4; syncAndReturnAll()&#x8FD4;&#x56DE;&#x7ED3;&#x679C;
List<object> objectList = pipeline.syncAndReturnAll();
if (objectList == null || objectList.isEmpty()) {
return Collections.emptyMap();
}</object></string></string,></li>
</ul>
<p>// 4.&#x89E3;&#x6790;&#x7ED3;&#x679C;
Map<string,map<string, string="">&gt; resultMap = new HashMap<string, map<string,string="">&gt;();
for (int i = 0; i &lt; objectList.size(); i++) {
  Object object = objectList.get(i);
  Map<string, string=""> map = (Map<string, string="">) object;
  String key = keyList.get(i);
  resultMap.put(key, map);
}
return resultMap;
}
4.&#x5904;&#x7406;&#x4EBA;&#xFF1A;
&#x4FEE;&#x6539;&#x4E1A;&#x52A1;&#x4EE3;&#x7801;&#x3002;</string,></string,></string,></string,map<string,></p>
<p>&#x5341;&#x516B;&#x3001;&#x7BA1;&#x7406;&#x5458;&#x547D;&#x4EE4;&#xFF0C;&#x666E;&#x901A;&#x7528;&#x6237;&#x4E0D;&#x80FD;&#x6267;&#x884C;
1.&#x5F02;&#x5E38;&#x5806;&#x6808;
&#x547D;&#x4EE4;role&#x4E0D;&#x80FD;&#x88AB;&#x666E;&#x901A;&#x7528;&#x6237;&#x6267;&#x884C;&#xFF0C;&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#x6682;&#x672A;&#x5F00;&#x653E;&#x7684;Redis&#x547D;&#x4EE4;</p>
<p>redis.clients.jedis.exceptions.JedisDataException: ERR command role not support for normal user
2.&#x5F02;&#x5E38;&#x63CF;&#x8FF0;&#xFF1A;
&#x6539;&#x547D;&#x4EE4;&#x5C1A;&#x672A;&#x5F00;&#x653E;</p>
<p>3.&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;
&#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x8BE5;&#x547D;&#x4EE4;&#xFF0C;&#x5982;&#x679C;&#x6709;&#x9700;&#x6C42;&#x6216;&#x8005;&#x7591;&#x95EE;&#x53EF;&#x4EE5;&#x8054;&#x7CFB;&#x503C;&#x73ED;&#x4EBA;&#x5458;&#x3002;</p>
<p>4.&#x5904;&#x7406;&#x4EBA;
&#x4ECE;&#x6587;&#x6863;&#x4E2D;&#x786E;&#x8BA4;&#x8BE5;&#x547D;&#x4EE4;&#x662F;&#x5426;&#x5F00;&#x653E;</p>
<p>&#x5176;&#x4ED6;&#x95EE;&#x9898;&#xFF1A;
1.Jedis&#x7248;&#x672C;&#x5982;&#x4F55;&#x9009;&#x62E9;&#xFF1A;
&#x539F;&#x5219;&#x4E0A;&#x9009;&#x62E9;&#x6700;&#x65B0;&#x7684;release&#x7248;&#x672C;&#xFF0C;&#x4F46;&#x6700;&#x597D;&#x9009;&#x62E9;release&#x4E00;&#x6BB5;&#x65F6;&#x95F4;&#x540E;&#x7684;&#x7248;&#x672C;&#xFF0C;&#x56E0;&#x4E3A;jedis&#x5386;&#x53F2;&#x4E0A;&#x51FA;&#x73B0;&#x8FC7;&#x4E00;&#x6B21;&#x95EE;&#x9898;&#x8F83;&#x5927;&#x7684;release&#x7248;&#x672C;&#xFF0C;&#x76EE;&#x524D;&#x6765;&#x8BF4;2.9.0&#x6BD4;&#x8F83;&#x7A33;&#x5B9A;&#x3002;</p>
<p><dependency>
    <groupid>redis.clients</groupid>
    <artifactid>jedis</artifactid>
    <version>2.9.0</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>
2.Jedis&#x4E2D;&#x7684;JedisCluster&#x662F;&#x963F;&#x91CC;&#x4E91;Redis&#x96C6;&#x7FA4;&#x7248;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x5417;&#xFF1F;
&#x7B54;&#xFF1A;&#x4E0D;&#x662F;&#xFF0C;&#x4F7F;&#x7528;&#x963F;&#x91CC;&#x4E91;&#x96C6;&#x7FA4;&#x7248;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#xFF0C;&#x76F4;&#x63A5;&#x4F7F;&#x7528;Jedis&#x548C;JedisPool&#x5373;&#x53EF;&#x3002;&#x56E0;&#x4E3A;&#x5B98;&#x65B9;&#x96C6;&#x7FA4;&#x548C;&#x963F;&#x91CC;&#x4E91;Redis&#x96C6;&#x7FA4;&#x662F;&#x4E0D;&#x540C;&#x7684;&#x67B6;&#x6784;&#xFF0C;&#x5177;&#x4F53;&#x53C2;&#x8003;&#xFF1A;redis4.0&#x3001;codis&#x3001;&#x963F;&#x91CC;&#x4E91;redis 3&#x79CD;redis&#x96C6;&#x7FA4;&#x5BF9;&#x6BD4;&#x5206;&#x6790;</p>
<p>......&#x5176;&#x4ED6;&#x5F85;&#x8865;&#x5145;......
&#x9644;&#x8D60;&#x8FDE;&#x63A5;&#x6C60;&#x53C2;&#x6570;</p>
<ol>
<li>&#x8D44;&#x6E90;&#x8BBE;&#x7F6E;&#x548C;&#x4F7F;&#x7528;
&#x5E8F;&#x53F7;    &#x53C2;&#x6570;&#x540D;    &#x542B;&#x4E49;    &#x9ED8;&#x8BA4;&#x503C;    &#x4F7F;&#x7528;&#x5EFA;&#x8BAE;
1    maxTotal    &#x8D44;&#x6E90;&#x6C60;&#x4E2D;&#x6700;&#x5927;&#x8FDE;&#x63A5;&#x6570;    8    &#x8BBE;&#x7F6E;&#x5EFA;&#x8BAE;&#x89C1;&#x4E0B;&#x8282;
2    maxIdle    &#x8D44;&#x6E90;&#x6C60;&#x5141;&#x8BB8;&#x6700;&#x5927;&#x7A7A;&#x95F2;&#x7684;&#x8FDE;&#x63A5;&#x6570;    8    &#x8BBE;&#x7F6E;&#x5EFA;&#x8BAE;&#x89C1;&#x4E0B;&#x8282;
3    minIdle    &#x8D44;&#x6E90;&#x6C60;&#x786E;&#x4FDD;&#x6700;&#x5C11;&#x7A7A;&#x95F2;&#x7684;&#x8FDE;&#x63A5;&#x6570;    0    &#x8BBE;&#x7F6E;&#x5EFA;&#x8BAE;&#x89C1;&#x4E0B;&#x8282;
4    blockWhenExhausted    &#x5F53;&#x8D44;&#x6E90;&#x6C60;&#x7528;&#x5C3D;&#x540E;&#xFF0C;&#x8C03;&#x7528;&#x8005;&#x662F;&#x5426;&#x8981;&#x7B49;&#x5F85;&#x3002;&#x53EA;&#x6709;&#x5F53;&#x4E3A;true&#x65F6;&#xFF0C;&#x4E0B;&#x9762;&#x7684;maxWaitMillis&#x624D;&#x4F1A;&#x751F;&#x6548;    true    &#x5EFA;&#x8BAE;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x503C;
5    maxWaitMillis    &#x5F53;&#x8D44;&#x6E90;&#x6C60;&#x8FDE;&#x63A5;&#x7528;&#x5C3D;&#x540E;&#xFF0C;&#x8C03;&#x7528;&#x8005;&#x7684;&#x6700;&#x5927;&#x7B49;&#x5F85;&#x65F6;&#x95F4;(&#x5355;&#x4F4D;&#x4E3A;&#x6BEB;&#x79D2;)    -1&#xFF1A;&#x8868;&#x793A;&#x6C38;&#x4E0D;&#x8D85;&#x65F6;    &#x4E0D;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x503C;
6    testOnBorrow    &#x5411;&#x8D44;&#x6E90;&#x6C60;&#x501F;&#x7528;&#x8FDE;&#x63A5;&#x65F6;&#x662F;&#x5426;&#x505A;&#x8FDE;&#x63A5;&#x6709;&#x6548;&#x6027;&#x68C0;&#x6D4B;(ping)&#xFF0C;&#x65E0;&#x6548;&#x8FDE;&#x63A5;&#x4F1A;&#x88AB;&#x79FB;&#x9664;    false    &#x4E1A;&#x52A1;&#x91CF;&#x5F88;&#x5927;&#x65F6;&#x5019;&#x5EFA;&#x8BAE;&#x8BBE;&#x7F6E;&#x4E3A;false(&#x591A;&#x4E00;&#x6B21;ping&#x7684;&#x5F00;&#x9500;)&#x3002;
7    testOnReturn    &#x5411;&#x8D44;&#x6E90;&#x6C60;&#x5F52;&#x8FD8;&#x8FDE;&#x63A5;&#x65F6;&#x662F;&#x5426;&#x505A;&#x8FDE;&#x63A5;&#x6709;&#x6548;&#x6027;&#x68C0;&#x6D4B;(ping)&#xFF0C;&#x65E0;&#x6548;&#x8FDE;&#x63A5;&#x4F1A;&#x88AB;&#x79FB;&#x9664;    false    &#x4E1A;&#x52A1;&#x91CF;&#x5F88;&#x5927;&#x65F6;&#x5019;&#x5EFA;&#x8BAE;&#x8BBE;&#x7F6E;&#x4E3A;false(&#x591A;&#x4E00;&#x6B21;ping&#x7684;&#x5F00;&#x9500;)&#x3002;
8    jmxEnabled    &#x662F;&#x5426;&#x5F00;&#x542F;jmx&#x76D1;&#x63A7;&#xFF0C;&#x53EF;&#x7528;&#x4E8E;&#x76D1;&#x63A7;    true    &#x5EFA;&#x8BAE;&#x5F00;&#x542F;&#xFF0C;&#x4F46;&#x5E94;&#x7528;&#x672C;&#x8EAB;&#x4E5F;&#x8981;&#x5F00;&#x542F;
2.&#x7A7A;&#x95F2;&#x8D44;&#x6E90;&#x76D1;&#x6D4B;
&#x7A7A;&#x95F2;Jedis&#x5BF9;&#x8C61;&#x68C0;&#x6D4B;&#xFF0C;&#x4E0B;&#x9762;&#x56DB;&#x4E2A;&#x53C2;&#x6570;&#x7EC4;&#x5408;&#x6765;&#x5B8C;&#x6210;&#xFF0C;testWhileIdle&#x662F;&#x8BE5;&#x529F;&#x80FD;&#x7684;&#x5F00;&#x5173;&#x3002;</li>
</ol>
<p>&#x5E8F;&#x53F7;    &#x53C2;&#x6570;&#x540D;    &#x542B;&#x4E49;    &#x9ED8;&#x8BA4;&#x503C;    &#x4F7F;&#x7528;&#x5EFA;&#x8BAE;
1    testWhileIdle    &#x662F;&#x5426;&#x5F00;&#x542F;&#x7A7A;&#x95F2;&#x8D44;&#x6E90;&#x76D1;&#x6D4B;    false    true
2    timeBetweenEvictionRunsMillis    &#x7A7A;&#x95F2;&#x8D44;&#x6E90;&#x7684;&#x68C0;&#x6D4B;&#x5468;&#x671F;(&#x5355;&#x4F4D;&#x4E3A;&#x6BEB;&#x79D2;)    -1&#xFF1A;&#x4E0D;&#x68C0;&#x6D4B;    &#x5EFA;&#x8BAE;&#x8BBE;&#x7F6E;&#xFF0C;&#x5468;&#x671F;&#x81EA;&#x884C;&#x9009;&#x62E9;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x9ED8;&#x8BA4;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E0B;&#x9762;JedisPoolConfig&#x4E2D;&#x7684;&#x914D;&#x7F6E;
3    minEvictableIdleTimeMillis    &#x8D44;&#x6E90;&#x6C60;&#x4E2D;&#x8D44;&#x6E90;&#x6700;&#x5C0F;&#x7A7A;&#x95F2;&#x65F6;&#x95F4;(&#x5355;&#x4F4D;&#x4E3A;&#x6BEB;&#x79D2;)&#xFF0C;&#x8FBE;&#x5230;&#x6B64;&#x503C;&#x540E;&#x7A7A;&#x95F2;&#x8D44;&#x6E90;&#x5C06;&#x88AB;&#x79FB;&#x9664;    1000 60 30 = 30&#x5206;&#x949F;    &#x53EF;&#x6839;&#x636E;&#x81EA;&#x8EAB;&#x4E1A;&#x52A1;&#x51B3;&#x5B9A;&#xFF0C;&#x5927;&#x90E8;&#x5206;&#x9ED8;&#x8BA4;&#x503C;&#x5373;&#x53EF;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x8003;&#x8651;&#x4F7F;&#x7528;&#x4E0B;&#x9762;JeidsPoolConfig&#x4E2D;&#x7684;&#x914D;&#x7F6E;
4    numTestsPerEvictionRun    &#x505A;&#x7A7A;&#x95F2;&#x8D44;&#x6E90;&#x68C0;&#x6D4B;&#x65F6;&#xFF0C;&#x6BCF;&#x6B21;&#x7684;&#x91C7;&#x6837;&#x6570;    3    &#x53EF;&#x6839;&#x636E;&#x81EA;&#x8EAB;&#x5E94;&#x7528;&#x8FDE;&#x63A5;&#x6570;&#x8FDB;&#x884C;&#x5FAE;&#x8C03;,&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E3A;-1&#xFF0C;&#x5C31;&#x662F;&#x5BF9;&#x6240;&#x6709;&#x8FDE;&#x63A5;&#x505A;&#x7A7A;&#x95F2;&#x76D1;&#x6D4B; </p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; jisong.fun  all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-11-18 18:04:57
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="0-README.html" class="navigation navigation-prev " aria-label="Previous page: Redis">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Redis info详解.html" class="navigation navigation-next " aria-label="Next page: Redis info详解">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Jedis常见问题汇总","level":"2.7.1","depth":2,"next":{"title":"Redis info详解","level":"2.7.2","depth":2,"path":"Developer/Redis/Redis info详解.md","ref":"Developer/Redis/Redis info详解.md","articles":[]},"previous":{"title":"Redis","level":"2.7","depth":1,"path":"Developer/Redis/0-README.md","ref":"Developer/Redis/0-README.md","articles":[{"title":"Jedis常见问题汇总","level":"2.7.1","depth":2,"path":"Developer/Redis/Jedis常见问题汇总.md","ref":"Developer/Redis/Jedis常见问题汇总.md","articles":[]},{"title":"Redis info详解","level":"2.7.2","depth":2,"path":"Developer/Redis/Redis info详解.md","ref":"Developer/Redis/Redis info详解.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","-highlight","-livereload","search-plus@^0.0.11","simple-page-toc@^0.1.1","-github@^2.0.0","-github-buttons@2.1.0","-edit-link@^2.0.2","-disqus@^0.1.0","prism@^2.1.0","prism-themes@^0.0.2","advanced-emoji@^0.2.1","anchors@^0.7.1","include-codeblock@^3.0.2","ace@^0.3.2","emphasize@^1.1.0","-katex@^1.1.3","splitter@^0.0.8","mermaid-gb3@2.1.0","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","sectionx@^3.1.0","-donate@^1.0.2","-local-video@^1.0.1","-sitemap-general@^0.1.1","anchor-navigation-ex@0.1.8","favicon@^0.0.2","todo@^0.1.3","3-ba@^0.9.0","-terminal@^0.3.2","-alerts@^0.2.0","include-csv@^0.1.0","puml@^1.0.1","musicxml@^1.0.2","klipse@^1.2.0","-versions-select@^0.1.1","-rss@^3.0.2","-sharing","sharing-plus@^0.0.2","graph@^0.1.0","chart@^0.2.0","summary"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright © jisong.fun ","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"include-csv":{},"disqus":{"shortName":"note-book"},"emphasize":{},"ace":{},"github":{"url":"https://gitee.com/ji-song/note-book"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"todo":{},"summary":{"excludeDir":["assets","styles","**/assets","resources"],"readme":"0-README.md","introduction":{"title":"继松的笔记","file":"README.md"}},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"graph":{},"donate":{"wechat":"https://ji-song.com/resource/weixin.png","alipay":"https://ji-song.com/resource/alipay.png","title":"","button":"赏","alipayText":"支付宝打赏","wechatText":"微信打赏"},"sitemap-general":{"prefix":"http://gitbook.ji-song.com"},"fontsettings":{"theme":"white","family":"sans","size":2},"rss":{"title":"继松的书","description":"记录点滴","author":"JiSong Sun","feed_url":"http://gitbook.ji-song.com/rss","site_url":"http://gitbook.ji-song.com/","managingEditor":"me@ji-song.com","webMaster":"me@ji-song.com","categories":["gitbook"]},"musicxml":{},"sectionx":{"tag":"b"},"mermaid-gb3":{},"anchor-navigation-ex":{"isRewritePageTitle":false,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"favicon":{"shortcut":"favicon.ico","bookmark":"favicon.ico"},"prism-themes":{},"github-buttons":{"repo":"ji-song/note-book","types":["star"],"size":"small"},"3-ba":{"configuration":"auto","token":"ff100361cdce95dd4c8fb96b4009f7bc"},"expandable-chapters-small":{},"klipse":{"myConfigKey":"it's the default value"},"versions":{"options":[{"value":"http://gitbook.ji-song.com","text":"v3.2.3"},{"value":"http://gitbook.ji-song.com/v2/","text":"v2.6.4"}]},"advanced-emoji":{"embedEmojis":false},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":false,"all":["facebook","google","twitter","weibo","instapaper","linkedin","pocket","stumbleupon","qq","qzone"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":true,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":true},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"edit-link":{"base":"https://github.com/ji-song/gitbook-use/edit/master","label":"Edit This Page"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"chart":{"type":"c3"},"search-plus":{}},"theme":"default","author":"jisong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"继松的书","language":"zh-hans","output.name":"site","links":{"sidebar":{"Home":"http://ji-song.gitee.io/cc"}},"gitbook":"3.2.3","description":"记录点滴"},"file":{"path":"Developer/Redis/Jedis常见问题汇总.md","mtime":"2019-11-18T10:04:57.296Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-04-14T08:13:26.502Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-3-ba/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/osmd.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/musicxml.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/promise.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    <script src="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

